<?php
	require_once("../../../oh.framework/oh.framework.php");	
	oh("htaccess")->enable();
	oh("dtd");	
?>
<hmtl>
<head>
<style>
	body {
		font-family:Verdana;
		font-size:16px;
		margin:0;
		padding:0;
	}
	.navbar {
		background:#d2d2d2;
		border-bottom:1px solid #7e7e7e;
		padding:3px;
		text-align:center;
	}
	.navbar input {
		border:none;
		background:#f2f2f2;
		color:#666666;
		font-size:14px;
		font-family:Verdana;
	}
	.navbar input.i {
		width:80%;
	}
	.urlgenerated {
		text-align:center;
		padding:40px;
		background:#eee277;
		border-bottom:1px solid #aaa033;
		color:#aaa033;
	}
	.error {
		padding:40px;
		background:#FF6C4B;
		color:#771414;
		border-bottom:1px solid #aa4C2B;		
		text-align:center;
	}
</style>	
<script>
	function l() {
		document.f.url.focus();
	}
	function onsubmit_f() {
		document.f.submit();
	}
</script>
</head>
<body onload="javascript:l();">
	<div class="navbar">
	<?php oh("simpleform")->open("f")->text("url","",'class="i"')->submit("Vai")->close(); ?>
	</div>
	<?php 
		if (oh("simpleform")->onsubmit("f")) {
			if (oh("simpleform.f.url") == "") {
				echo '<div class="error">';
				echo 'Errore: ';
				echo '</div>';			
			} else {
				echo '<div class="urlgenerated">';
				echo 'Ecco il tuo URL breve: ';
				echo '</div>';
			}
		}
	?>
</body>
</html>
